
enum Api {
	UserLogin = '/Api/MF_ManagerFront/MF_Login/PostLogin',
	PostSms = '/Api/MF_ManagerFront/MF_Login/PostSms',
	PostUpdatePasswordByCode = '/Api/MF_ManagerFront/MF_Home/PostUpdatePassword_Code'
}
	
export interface LoginParams {
	Account_Phone: string,
	Code: string,
	PassWord: string,
	OpenId: string,
	// 1 账号密码登录 2 验证码登录
	Type: number
}


export function useLoginApi(vm) {
	
	const userLogin = (params: LoginParams) => {
		return vm.$u.post(Api.UserLogin, params)
	}
	
	const getSms = (params) => {
		return vm.$u.post(Api.PostSms, params)
	}
	
	const updatePasswordByCode = (params) => {
		return vm.$u.post(Api.PostUpdatePasswordByCode, params)
	}
	
	return {
		userLogin,
		getSms,
		updatePasswordByCode
	}
}